package com.sharemarking.application.common.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;

import com.sharemarking.application.common.BaseRepository;
import com.sharemarking.application.common.entity.Comment;

public interface CommentRepo extends BaseRepository<Comment> {
	@Query(value = "select * from sys_comment c where c.state='0' and (c.from_uid=?1 or c.to_uid=?2)",nativeQuery = true)
	List<Comment> findBycState(Integer from_uid,Integer to_uid);
	@Query(value = "select count(*) from sys_comment c where c.state=0 and (c.from_uid=?1 or c.to_uid=?2)",nativeQuery = true)
	Integer findBycountState(Integer from_uid,Integer to_uid);

}
